from selenium import webdriver
import time

from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.select import Select
driver = webdriver.Chrome()
driver.get("file:///E:/工作/python/Python_web/test.html")

driver.find_element_by_name('一个弹窗').click()
#保存设置

alter_text=driver.switch_to_alert.text
#通过switch_t0_alert.text来获取警告框信息
print(alter_text)